package com.example.lanqiaodemo1.JavaTest4;

import java.util.ArrayList;

public class Circle implements Shape {
    double r;
    public Circle(double r) {
        this.r = r;
    }
    public Circle() { }
    @Override
    public double getArea() {
        return Math.PI * r * r;
    }
    @Override
    public double getPerimeter() {
        return 2 * Math.PI * r;
    }
}
class test1{

    public static void main(String[] args) {
        Circle circle = new Circle(2);
        System.out.println(circle.getArea());
        System.out.println(circle.getPerimeter());
    }
}